import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';
//配件类型维护-主机厂
//配件类型维护查询-主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rpCmsAccessoriesType/getListByPage`, params);
//新增弹窗-数据保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rpCmsAccessoriesType/updateByPtId`, params);
//主页面的单条删除
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rpCmsAccessoriesType/saveOne`,  params);
//配件类型查询
export const selectListByPage = params => axios.get(`${SERVER.CLAIMFAC}/rPPtType/getListByPage`,params);
//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPPtType/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rpCmsAccessoriesType/getListForExport`, params, {
    responseType: 'blob'
  });
//下载中心导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);
//字典
export const getPartType = (params) => axios.get(`${SERVER.CLAIMFAC}/const/getBaseDataByType`, {params});

//获取配件
export const getPartList = params =>
  axios.get(`${SERVER.CLAIMFAC}/const/getPartList`, {
    params
  });
//配件类型预编辑
export const selectById = (id, params) => axios.get(`${SERVER.CLAIMFAC}/rpCmsAccessoriesType/selectById/${id}`, { params });
